<template>
  <div>
    <header>热门推荐</header>
    <ol class="recommend-list">
      <router-link custom :to="'/detail/' + item.id" v-slot="{ navigate }" v-for="item in recommendList" :key="item.id">
        <li class="border-bottom-1px" @click="navigate">
          <img :src="item.imgUrl" alt="" />
          <h4>{{ item.title }}</h4>
          <p>{{ item.desc }}</p>
          <span><b>￥23</b>起</span>
        </li>
      </router-link>
    </ol>
    <p class="more"><a href="">查看所有产品</a></p>
  </div>
</template>

<script>
export default {
  name: 'Recommend',
  props: ['recommendList'],
  data() {
    return {}
  },
}
</script>

<style lang="scss" scoped>
header {
  line-height: 0.8rem;
  background: #eee;
  padding-left: 0.2rem;
}
.recommend-list {
  // li:last-child::before {
  //   display: none;
  // }
  li {
    overflow: hidden;
    padding: 0.2rem;
    img {
      float: left;
      width: 1.7rem;
      height: 1.7rem;
      margin-right: 0.2rem;
    }
    h4 {
      margin-top: 0.1rem;
      margin-bottom: 0.1rem;
      font-size: 0.32rem;
      @include text-ellipsis;
    }
    p {
      margin-bottom: 0.1rem;
      @include text-ellipsis(2);
    }
    b {
      font-size: 0.36rem;
      color: #ff9300;
      font-weight: normal;
      margin-right: 0.1rem;
    }
  }
}
.more {
  line-height: 0.8rem;
  text-align: center;
  a {
    color: #0099ff;
  }
}
</style>
